package com.hq.fxh.No1_Infromation.Video.Adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

import com.hq.fxh.R;
import com.hq.fxh.Utils.LogUtils;
import com.hq.fxh.Utils.Tool;

import java.util.ArrayList;

/**
 * /**
 *
 * @author 薛
 * @ClassName
 * @Description :
 * @Created 2017/8/15
 * @Email xlwenhao1858@sina.com
 */


public class Help_VideoDetils_TuiJian {
    protected View rootView;
    protected ListView listVideoDetailTuiJian;
    Context context;
    ArrayList<String> datas;
    private int itemHeight;

    public Help_VideoDetils_TuiJian(Context context, ArrayList<String> datas) {
        this.context = context;
        this.datas = datas;

    }

    public View getView() {
        View view=LayoutInflater.from(context).inflate(R.layout.videodetail_tuijian_item, null);
        initView(view);
        initData();
        return view;
    }

    public void initData() {
        listVideoDetailTuiJian.setAdapter(new Adapter_VideoDetail_Tuijian());
        listVideoDetailTuiJian.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                LogUtils.e("新闻推荐" + i);
            }
        });

        Tool.setListViewHeightBasedOnChildren(listVideoDetailTuiJian);

    }


    private void initView(View rootView) {
        listVideoDetailTuiJian = (ListView) rootView.findViewById(R.id.list_VideoDetail_TuiJian);
    }



}
